package com.example.myapplication.common

import androidx.annotation.DrawableRes
import androidx.compose.foundation.Image
import androidx.compose.foundation.LocalIndication
import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp

@Composable
fun ImageButton(@DrawableRes imageId: Int, modifier: Modifier ,contentDescription: String, onClick: () -> Unit) {
    Image(
        painter = painterResource(imageId),
        contentDescription = contentDescription,
        modifier = modifier
            .clickable(
                onClick = { onClick() },
                indication = LocalIndication.current,
                interactionSource = remember { MutableInteractionSource() })
    )
}